<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" %>
<%@ include file="/WEB-INF/jsp/common/common.jsp" %>
<html>
<head>
    <title>销售订单列表</title>
    <!--
        jquery日期样式的导入
    -->
    <script type="text/javascript">
        $(document).ready(function () {
            $("body").data("url", "${pageContext.request.contextPath}/business/salePredictOrder/listSalePredictOrder?childQuery.salePredictOrderMainId=");
            //点击主表中的某一行加载子表
            GylUtils.business.zhubTRClick();
            GylUtils.business.disPage.zhubDispageEvent();
            GylUtils.business.disPage.zhibDispageEvent();
            /* //使用class属性处理  'yy-mm-dd' 设置格式"yyyy/mm/dd"
             $('#dhrq').datepick({dateFormat: 'yy-mm-dd'});
             //$('#sxrq').datepick({dateFormat: 'yy-mm-dd'});*/
        });
        $(function () {
            $('.tab li').mouseover(function () {
                var num = $(this).index() - 1;
                $(this).addClass('current').siblings().removeClass();
                $('this:eq(num)').remove('span');
            })
        });
        $(function () {
            $('li').mouseover(function () {
                $(this).addClass('current').siblings().removeClass('current');
            })
        });
        function data() {
            window.open("customer.html", 100, 200);
        }
    </script>
</head>
<body>
<table id="wrap">
    <form action="${pageContext.request.contextPath}/business/salePredictOrder/listSalePredictOrder" method="get">
        <tr>
            <td class="rig_top">
                <div style="overflow:auto; height:190px; width:1150px;">
                    <table class="content" style="font-size:12px; text-align: center">
                        <tr>
                            <td class="one" style="color:#00F;">单据号</td>
                            <td class="inp"><input
                                    name="mainQuery.orderNo" value="${orderVO.mainQuery.orderNo}"/>
                            </td>
                            <td class="one" style="width:66px;">订货日期</td>
                            <td class="inp"><input type="text" name="mainQuery.orderTime" value="${orderVO.mainQuery.orderTime}">
                            </td>
                        </tr>
                        <tr>
                            <td style="color:#00F">客户名称</td>
                            <td class="inp"><input name="mainQuery.customerName" value="${orderVO.mainQuery.customerName}">
                            </td>
                        </tr>
                        <tr>
                            <td class="one" style="color:#00F">销售部门</td>
                            <td class="inp"><input type="text"
                                                   style="background:url(/images/search.png) no-repeat 226px center #F6F9FD;"
                                                   onclick="data()"/></td>
                            <td class="one" style="color:#00F">业务员</td>
                            <td class="inp"><input type="text"
                                                   style="background:url(/images/search.png) no-repeat 226px center #F6F9FD;"
                                                   onclick="data()"/></td>
                        </tr>
                        <tr>
                            <td class="one" style="color:#00F">审批人</td>
                            <td class="inp"><input type="text"
                                                   style="background:url(/images/search.png) no-repeat 226px center #F6F9FD;"
                                                   onclick="data()"/></td>
                            <td class="one" style="width:66px;">审批日期</td>
                            <td class="inp"><input type="text" <%--name='mainQuery.examineTime'--%>/><%--value="${salePredictOrderVO.mainQuery.examineTime}"--%>
                            </td>
                        </tr>
                        <tr>
                            <td class="one" style="color:#00F">制单人</td>
                            <td class="inp"><input type="text"
                                                   style="background:url(/images/search.png) no-repeat 226px center #F6F9FD;"
                                                   onclick="data()"/></td>
                            <td class="one" style="width:66px;">制单日期</td>
                            <td class="inp"><input
                                    type="datetime" <%--name="mainQuery.makeOrderTime"--%>/> <%--value="${salePredictOrderVO.mainQuery.makeOrderTime}"--%>
                            </td>
                            <td class="one" style="color:#00F">修改人</td>
                            <td class="inp"><input type="text"
                                                   style="background:url(/images/search.png) no-repeat 226px center #F6F9FD;"
                                                   onclick="data()"/></td>
                        </tr>
                        <tr>
                            <td class="one" style="width:66px;">修改日期</td>
                            <td class="inp"><input type="text"/></td>
                        </tr>
                        <tr>
                            <td colspan="5"></td>
                            <td height="40" align="center"><input type="submit" value="查询" class="search"/></td>
                        </tr>
                    </table>
                </div>
            </td>
        </tr>
        <tr>
            <td class="rig_top">
                <div style="overflow:auto; height:230px; width:1150px;">
                    <table cellspacing="0" cellpadding="0" id="maintain-top" align="center"
                           style="font-size:12px; text-align: center">
                        <tr class="one">
                            <td width="100px">单据号</td>
                            <td width="90">订货日期</td>
                            <td width="180">客户名称</td>
                            <td style="color:#00F;" width="90">销售部门</td>
                            <td width="90">业务员</td>
                            <td width="180">预订单状态</td>
                        </tr>
                        <!--
                            pageResult_zhub.rows  List<Xsyddzhub>
                         -->
                        <c:forEach var="saleMain" items="${saleMains.rows}">
                            <!--
                            field属性是用来确认是主表的tr
                            -->
                            <tr field="item_zhub" id="${saleMain.id}">
                                <td style="border-collapse:collapse;  empty-cells:show;">${saleMain.orderNo}</td>
                                <td style="border-collapse:collapse;  empty-cells:show;">${saleMain.orderTime}</td>
                                <td style="border-collapse:collapse;  empty-cells:show;">${saleMain.customerName}</td>
                                <td style="border-collapse:collapse;  empty-cells:show;">${saleMain.saleDepartmentName}</td>
                                <td style="border-collapse:collapse;  empty-cells:show;">${saleMain.salesmanName}</td>
                                <td style="border-collapse:collapse;  empty-cells:show;">${saleMain.status}</td>
                            </tr>
                        </c:forEach>
                        <tr>
                            <td style="border:0"></td>
                        </tr>
                    </table>
                    <p style="width:1800px; height:20px;font-size:12px;">
	<span class="page" style="float:right">
		<input type="button" param="1" flag="zhub_firstPage" value="首页"/>&nbsp;<input type="button" flag="zhub_prePage"
                                                                                      param="${saleMains.pageNum - 1}"
                                                                                      value="上一页"/>&nbsp;<input
            type="button" param="${saleMains.pageNum + 1}" flag="zhub_nextPage" value="下一页"/>&nbsp;<input
            type="button" param="${saleMains.totalPages}" flag="zhub_lastPage" value="尾页"/>&nbsp;<span>转到第<input
            name="mainQuery.pageNum" id="pageNo" type="text" value="${saleMains.pageNum}" size="4"
            style="height:16px; width:28px; border:1px solid #999999; background:#FFF; border-radius:0;"/>页 </span>&nbsp;&nbsp;<input
            type="button" value="转" style=" padding:0 10px;"/>
	</span>&nbsp;&nbsp;共有${saleMains.totalRows}条记录，当前第 ${saleMains.pageNum}/${saleMains.totalPages}页
                    </p>
                </div>
            </td>
        </tr>

        <tr>
            <td id="right_center">
                <div style="height:213px; width:1150px; overflow:auto;">
                    <table cellspacing="0" cellpadding="0" id="maintain-right"
                           style="font-size:12px; text-align: center">
                        <tr class="two" align="center">
                            <td style="width:10px; border-right:0">&nbsp;</td>
                            <td width="50">行号</td>
                            <td style="color:#00F;border:1px solid #9EB6CE; border-left:0;
                            " width="100">商品编码
                            </td>
                            <td width="200">商品名称</td>
                            <td width="100">型号</td>
                            <td width="100">单位</td>
                            <td width="100">数量</td>
                            <td width="100">税率</td>
                            <td width="100">单品扣率</td>
                            <td width="100">无税单价</td>
                            <td width="100">含税单价</td>
                            <td width="100">无税金额</td>
                            <td width="100">含税金额</td>
                            <td width="100">税额</td>
                            <td width="200">折扣额</td>
                            <td width="200">收货单位</td>
                        </tr>


                        <!--
                                创建一个隐藏域,保存点击的主表的id
                         -->
                        <input type="hidden" name="childQuery.salePredictOrderMainId"/>
                        <c:forEach items="${saleChildren.rows}" var="saleChild" varStatus="status" step="1">
                            <!--
                            当点击主表中的某一行的时候，加载子表中的内容，当对子表加载上一页或者下一页的时候，应该针对主表中的某一行加载
                            所以在子表分页的时候，应该传递一个参数：主表的id
                            -->
                            <tr class="other">
                                <td align="center"
                                    style="background:#E2E2E2;height:19px; border:0; border-right:1px solid #9EB6CE; border-bottom:1px solid #9EB6CE;">
                                        ${status.index}</td>
                                <td style="border-collapse:collapse;  empty-cells:show;">${saleChild.lineNo}</td>
                                <td style="border-collapse:collapse;  empty-cells:show;">${saleChild.productNo}</td>
                                <td style="border-collapse:collapse;  empty-cells:show;">${saleChild.productName}</td>
                                <td style="border-collapse:collapse;  empty-cells:show;">${saleChild.productType}</td>
                                <td style="border-collapse:collapse;  empty-cells:show;">${saleChild.unit}</td>
                                <td style="border-collapse:collapse;  empty-cells:show;">${saleChild.amount}</td>
                                <td style="border-collapse:collapse;  empty-cells:show;">${saleChild.taxRate}</td>
                                <td style="border-collapse:collapse;  empty-cells:show;">${saleChild.singleTaxRate}</td>
                                <td style="border-collapse:collapse;  empty-cells:show;">${saleChild.noTaxUnitPrice}</td>
                                <td style="border-collapse:collapse;  empty-cells:show;">${saleChild.hasTaxUnitPrice}</td>
                                <td style="border-collapse:collapse;  empty-cells:show;">${saleChild.noTaxTotalPrice}</td>
                                <td style="border-collapse:collapse;  empty-cells:show;">${saleChild.hasTaxTotalPrice}</td>
                                <td style="border-collapse:collapse;  empty-cells:show;">${saleChild.totalTaxPrice}</td>
                                <td style="border-collapse:collapse;  empty-cells:show;">${saleChild.discount}</td>
                                <td style="border-collapse:collapse;  empty-cells:show;">${saleChild.shipping}</td>
                            </tr>
                        </c:forEach>

                        <tr class="other">
                            <td style="border:0"></td>
                        </tr>
                    </table>
                    <p style="width:1800px; height:20px;font-size:12px;">
	<span class="page" style="float:right">
		<input type="button" param="1" flag="zhib_firstPage" value="首页"/>&nbsp;<input type="button" flag="zhib_prePage"
                                                                                      param="${saleChildren.pageNum-1}"
                                                                                      value="上一页"/>&nbsp;<input
            type="button" flag="zhib_nextPage" param="${saleChildren.pageNum+1}" value="下一页"/>&nbsp;<input
            type="button" flag="zhib_lastPage" param="${saleChildren.totalPages}" value="尾页"/>&nbsp;<span>转到第<input
            name="queryChild.pageNum" id="pageNo_zhib" type="text" value="${saleChildren.pageNum}" size="4"
            style="height:16px; width:28px; border:1px solid #999999; background:#FFF; border-radius:0;"/>页 </span>&nbsp;&nbsp;<input
            type="button" value="转" style=" padding:0 10px;"/>
	</span>&nbsp;&nbsp;共有${saleChildren.totalRows}条记录，当前第 ${saleChildren.pageNum}/${saleChildren.totalPages}页
                    </p>
                </div>
            </td>
        </tr>
        <tr>
            <td id="mantain-bot">
                <div class="last"></div>
            </td>
        </tr>
    </form>
</table>
</body>
</html>
